cmake_minimum_required(VERSION 3.10)
project(dua)


set(OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_PATH})
set(LIBRARY_OUTPUT_PATH ${OUTPUT_PATH})

file(GLOB INCS inc/*.h)
file(GLOB SOURCES src/*)
add_library(dua
    ${INCS}
    ${SOURCES}
    ${HEADERS}
    )

target_include_directories(dua PRIVATE src)
target_include_directories(dua PUBLIC inc)
if(BUILD_SHARED_LIBS)
    target_compile_definitions(dua PUBLIC LAND_SCRIPT_EXPORTS)
endif()

if(WIN32)
    target_compile_definitions(dua PUBLIC WIN32)
    target_compile_definitions(dua PRIVATE _CRT_SECURE_NO_WARNINGS)
    target_compile_definitions(dua PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
endif()

if(LINUX)
    target_link_libraries(dua PUBLIC m)
    set_target_properties(dua PROPERTIES COMPILE_FLAGS -std=gnu99)
endif()


file(GLOB SOURCES test/src/*)
add_executable(dua_test ${SOURCES})
target_link_libraries(dua_test PUBLIC dua)
target_include_directories(dua_test PUBLIC src)

